package cz.pproproj.aaservice.guimodule.auth;

public class TokenInfo {

    private final String accessToken;
    private final String refreshToken;
    private final long expires;
    private final String module;


    public TokenInfo(String accessToken, String refreshToken, long expires, String moduleName) {
        this.accessToken = accessToken;
        this.refreshToken = refreshToken;
        this.expires = expires;
        this.module = moduleName;
    }

    public String getAccessToken() {
        return accessToken;
    }


    public String getRefreshToken() {
        return refreshToken;
    }


    public long getExpires() {
        return expires;
    }

    public String getModule() {
        return module;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TokenInfo tokenInfo = (TokenInfo) o;
        return accessToken.equals(tokenInfo.accessToken);
    }

    @Override
    public int hashCode() {
        return accessToken.hashCode();
    }
}
